<?php
$users = $lista;

$btn_delete = array(
    'name' => 'delete',
    'id' => 'delete',
    'value' => 'Delete',
    'class' => 'blockForm btn'
);
$btn_status = array(
    'name' => 'validate',
    'id' => 'validate',
    'value' => 'Validate',
    'class' => 'blockForm btn'
);
?>
<div id="show-list" class="ui-widget">

    <div class=" ui-widget-header ui-corner-all ui-helper-clearfix pushDown tCenter titulo">
        <span class="ui-dialog-title">USERS</span>
    </div>
    <table id="user" class="ui-widget ui-widget-content">
        <thead>
            <tr class="ui-widget-header ">
                <th>Username</th>
                <th>E-mail</th>
                <th>Status</th>
				<th colspan="2"  ></th>
            </tr>
        </thead>
        <tbody>
            <?php
            foreach ($users as $ac) {
                
            ?>
                <tr>
                    <td><?= $ac['username'] ?></td>
                    <td><?= $ac['email'] ?></td>
                    <td><?= $ac['status_user'] ?></td>

                        <td class="tCenter" style="width: 60px;">  
                            <?php
                            $action = 'session/delete_user';
                            $bt = $btn_delete;
                            ?>

                            <?= form_open($action); ?>
                            <?= form_hidden('id_user', $ac['id']); ?>
                            <?= form_submit($bt); ?>
                            <?= form_close(); ?>

                        </td>
						<?php if($ac['status_user']== 0 || $ac['status_user']== 1){
							
						?>
                        <td class="tCenter" style="width: 60px;">   
                            <?php
                            $action = 'session/validate_user';
                            $bt = $btn_status;
                            ?>

                            <?= form_open($action); ?>
                            <?= form_hidden('id_user', $ac['id']); ?>
                            <?= form_submit($bt); ?>
                            <?= form_close(); ?>

                        </td>
						<?php }?> 
                    <?php } ?>

                </tr>

        </body>
    </table>

    <?= $pager ?>

</div>



<script type="text/javascript">

    $('.btn').button().css({'font-size': '14px'});


</script>